<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateActivityInfoTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('activity_info', function (Blueprint $table) {
            $table->bigInteger('id', true);
            $table->bigInteger('data_version_id')->nullable()->index('dvid_idx')->comment('版本 id');
            $table->string('data_version_name', 255)->nullable()->comment('版本名称');
            $table->string('activity_category', 255)->nullable()->index('index_activity_category')->comment('数据类型 目前直接用FormKeyEnum 的主form的key');
            $table->string('name', 255)->nullable()->comment('活动名称/课程名称等');
            $table->date('date')->nullable();
            $table->date('begin_date')->nullable();
            $table->date('end_date')->nullable();
            $table->longText('pubications_publish_type')->nullable()->comment('论文论著发布类型');
            $table->longText('level')->nullable()->comment('级别 国家/  市/区');
            $table->longText('course')->nullable()->comment('学科');
            $table->longText('grade')->nullable()->comment('年级');
            $table->longText('class_item')->nullable()->comment('班级');
            $table->string('participant_object', 50)->nullable()->comment('参加对象');
            $table->string('remark', 255)->nullable()->comment('备注');
            $table->longText('witness')->nullable()->comment('证明人');
            $table->string('witness_position', 30)->nullable()->comment('证明人职务');
            $table->string('head_of_departs', 256)->nullable()->comment('证明人所在部门负责人');
            $table->longText('awarding_unit')->nullable()->comment('发奖单位');
            $table->longText('guided_teacher')->nullable()->comment('带教教师姓名');
            $table->longText('guided_teacher_school')->nullable()->comment('所在学校');
            $table->longText('proof_material')->nullable()->comment('证明材料 ');
            $table->string('customer_grade', 255)->nullable()->comment('自定义等级');
            $table->string('award_from', 255)->nullable()->comment('发奖单位');
            $table->longText('category')->nullable()->comment('获奖情况的奖项分类。');
            $table->longText('reception_class')->nullable()->comment('接待课');
            $table->bigInteger('form_instance_id')->nullable()->index('form_instance_id')->comment('formInstanceId');
            $table->string('teacher_name', 60)->nullable();
            $table->string('school_name', 50)->nullable()->comment('学校名称');
            $table->string('periodical', 50)->nullable()->comment('刊物名称');
            $table->boolean('is_published')->default(false)->comment('已发表：1-是，2-否');
            $table->boolean('is_core')->default(false)->comment('是否核心期刊：1-是，2-否');
            $table->boolean('is_awarded')->default(false)->comment('已获奖：1-是，2-否');
            $table->boolean('stage')->default(false)->comment('申报阶段：1-申报阶段，2-立项阶段，3-中期阶段，4-结项阶段');
            $table->text('award_recipient')->comment('获奖对象');
            $table->boolean('is_wsjl')->default(true)->comment('是否网上交流：1-是，2-否');
            $table->string('wsjl_info', 255)->default('')->comment('网上交流');
            $table->string('other_paper', 255)->nullable()->comment('论文其他');
            $table->boolean('treatise_type')->default(false)->comment('论著类型：1-正规出版，2-内部');
            $table->bigInteger('copy_id')->default(0)->comment('复制来源id');
            $table->string('zmd_remark', 255)->nullable()->comment('证明单备注/后续处理备注');
            $table->boolean('zm_style')->nullable()->default(false)->comment('形式：1-公开课，2-研究课');
            $table->boolean('zm_gkk_category')->nullable()->default(false)->comment('公开课类别：1-讲座，2-交流');
            $table->string('place', 255)->default('')->comment('地点');
            $table->string('target', 255)->default('')->comment('参与对象/学生');
            $table->integer('deleted')->nullable()->default(0)->index('deleted')->comment('是否被删除');
            $table->timestamp('created_at')->nullable()->useCurrent();
            $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable()->useCurrent();
            $table->bigInteger('creator_id')->nullable()->index('creator_id_idx');
            $table->bigInteger('updater_id')->nullable();
            $table->string('dj_category', 5)->default('')->comment('带教情况带教类别');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('activity_info');
    }
};
